#ifndef MEMOQUERYWIDGET_H
#define MEMOQUERYWIDGET_H

#include <QWidget>
#include <QtSql>

namespace Ui {
    class MemoQueryWidget;
}

class MemoQueryWidget : public QWidget {
    Q_OBJECT
public:
    MemoQueryWidget(QSqlDatabase _db, QWidget *parent = 0);
    ~MemoQueryWidget();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::MemoQueryWidget *ui;

//--------------------------------------------CUSTOM--------------------------------------------
private slots:
    void doTableIndexActivated(QModelIndex index);
signals:
    void activated(QString);
    void doSearch();
private:
    void customUI();
public slots:
    void doBtnSearch();



private:
    QSqlDatabase m_SqlDB;
private:
    QString m_strActiveID;
//for combox
private:
//    QSqlRelationalTableModel* m_pSqlRelationalTableModel;
    QSqlQueryModel* m_pComboxSqlQueryModel;
public:
    void updateComboxMemoLabel();

//table view
private:
    QSqlQueryModel* m_pTableViewModel;


};

#endif // MEMOQUERYWIDGET_H
